export default {
    component: 'jzlList',
    icon: 'fa fa-tasks',
    name: '动态列表',

    ele_style: {
        _name: '动态列表',
        _render: '_ele',
        _node: 'div',
        _ss: {
            theme: "txt-nav-list"
        },
        _sh: {},
        _rh: false,
        _sort: [ 'item' ],

        item: {
            _name: '列表项',
            _render: '_item',
            _node: 'list',
            _value: 'model',
            _ss: {
                theme: "txt-nav-item"
            },
            _sh: {},
            _rh: false,
            _sort: [ 'image', 'text', 'moreIcon' ],

            image: {
                _name: '图片',
                _render: '_image',
                _node: 'img',
                _value: 'image',
                _ss: {
                    theme: "txt-nav-img"
                },
                _sh: {},
                _rh: false
            },
            text: {
                _name: '文字',
                _render: '_text',
                _ss: {
                    theme: "txt-nav-text"
                },
                _sh: {},
                _rh: false,
                _sort: [ 'title', 'remark' ],

                title: {
                    _name: '标题',
                    _render: '_title',
                    _node: 'text',
                    _value: 'title',
                    _ss: {
                        theme: "txt-nav-title"
                    },
                    _sh: {},
                    _rh: false
                },
                remark: {
                    _name: '描述',
                    _render: '_remark',
                    _node: 'text',
                    _value: 'remark',
                    _ss: {
                        theme: "txt-nav-desc"
                    },
                    _sh: {},
                    _rh: false
                }
            },
            /*note: {
                _name: '提示',
                _common_style: _.defaultsDeep({}, _common_style),
            },*/
            moreIcon: {
                _name: '更多图标',
                _render: '_moreIcon',
                _node: 'icon',
                _ss: {
                    theme: "txt-nav-note",
                    icon: 'fa fa-angle-right'
                },
                _sh: {},
                _rh: false
            }
        }
    },
    setting: {
        sticky: false,
        loadMode: "hand",   // fixed - 定长内容 hand- 手动点击 auto - 滑到底部加载更多
    },
    vars: [{
        prop: "model",
        type: "json",
        label: "列表数据源",
        default: null,
        force: true,
        initType: "static",
        iTypes: [ 'static', 'api', 'mapi' ],
        iDis: true,
        defaultJson: [{
            image: "/assets/images/bg.png",
            title: "标题A",
            remark: "描述"
        }, {
            image: "/assets/images/bg.png",
            title: "标题B",
            remark: "描述"
        }]
    }, {
        prop: "totalRecords",
        iTypes: [ 'static' ],
        label: "接口数据的总条数取值字段",
        type: "string",
        default: "page.total",
        force: true,
        initType: "static"
    }, {
        prop: "pageSize",
        iTypes: [ 'static' ],
        label: "接口数据的每页条数，必须数字",
        type: "number",
        default: 20,
        force: true,
        initType: "static"
    }],
    data_schema: {       // 组件需要的字段
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "数据列表",
        "description": "list description",
        "type": "array",
        "items": {
            "title": "",
            "type": "object",
            "properties": {
                "title": {
                    "title": "名称",
                    "type": "string"
                },
                "remark": {
                    "title": "描述",
                    "type": "string",
                    'ui:options': {
                        type: 'textarea',
                        placeholder: '描述',
                        rows: 4
                    }
                },
                "image": {
                    "title": "图片",
                    "type": "string",
                    "ui:options": {
                        'widget': 'FilePicker'
                    }
                },
                "link": {
                    "title": "链接",
                    "type": "string",
                    "ui:options": {
                        'widget': 'LinkView',
                        'attrs': {

                        }
                    }
                }
            }
        }
    },
    setting_schema: {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "列表 LIST 组件参数设置",
        "description": "",
        "type": "object",
        "properties": {
            "loadMode": {
                "title": "展示模式",
                "type": "string",
                "ui:widget": "RadioWidget",
                "enum": [
                    "fixed",
                    "hand",
                    "auto"
                ],
                "enumNames": [
                    "固定条数",
                    "手动加载",
                    "滚动加载"
                ]
            }
        }
    }
}
